<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:76:"D:\phpstudy_pro\WWW\shao.gov.cn/application/admin\view\vg\villages\edit.html";i:1714392223;s:73:"D:\phpstudy_pro\WWW\shao.gov.cn\application\admin\view\template\base.html";i:1679567630;s:84:"D:\phpstudy_pro\WWW\shao.gov.cn\application\admin\view\template\javascript_vars.html";i:1679567630;}*/ ?>
﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title><?php echo \think\Config::get('site.title'); ?></title>
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/public/static/admin/lib/html5.js"></script>
    <script type="text/javascript" src="/public/static/admin/lib/respond.min.js"></script>
    <script type="text/javascript" src="/public/static/admin/lib/PIE_IE678.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/public/static/admin/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="/public/static/admin/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="/public/static/admin/lib/Hui-iconfont/1.0.7/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="/public/static/admin/lib/icheck/icheck.css"/>
    <link rel="stylesheet" type="text/css" href="/public/static/admin/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="/public/static/admin/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="/public/static/admin/css/app.css"/>
    <link rel="stylesheet" type="text/css" href="/public/static/admin/lib/icheck/icheck.css"/>
    
    <!--[if IE 6]>
    <script type="text/javascript" src="/public/static/admin/lib/DD_belatedPNG_0.0.8a-min.js"></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <!--定义JavaScript常量-->
<script>
    window.THINK_ROOT = '<?php echo \think\Request::instance()->root(); ?>';
    window.THINK_MODULE = '<?php echo \think\Url::build("/" . \think\Request::instance()->module(), "", false); ?>';
    window.THINK_CONTROLLER = '<?php echo \think\Url::build("___", "", false); ?>'.replace('/___', '');
</script>
</head>
<body>


<div class="page-container">
    <form class="form form-horizontal" id="form" method="post" action="<?php echo \think\Request::instance()->baseUrl(); ?>">
        <input type="hidden" name="id" value="<?php echo isset($vo['id'])?$vo['id']: ''; ?>">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>村名：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="<?php echo isset($vo['name'])?$vo['name']: ''; ?>" placeholder="" name="name" datatype="*"
                    nullmsg="请填写乡村名称">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>标签：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="<?php echo isset($vo['tag'])?$vo['tag']: ''; ?>" placeholder="" name="tag" datatype="*"
                    nullmsg="请填写乡村标签">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>详情：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <script id="editor" name="detail" type="text/plain"
                    style="height:400px"><?php if(isset($vo['detail'])): ?><?php echo htmlspecialchars_decode($vo['detail']); endif; ?></script>
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <div class="row cl">
                <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>乡村图片：</label>
                <div class="formControls col-xs-6 col-sm-6">
                    <input type="text" readonly class="input-text" value="<?php echo isset($vo['thumb'])?$vo['thumb']: ''; ?>" name="thumb" id="upload"
                        placeholder="请点击后面的上传按钮" datatype="*" nullmsg="请填写图片url" style="width: 70%">
                    <button type="button" class="btn btn-primary radius"
                        onclick="layer_open('文件上传','<?php echo \think\Url::build('Upload/index', ['id' => 'upload']); ?>')">上传</button>
                    <a onclick="$(this).attr('href', 'http://<?php echo \think\Request::instance()->host(); ?>/public'+$('#upload').val())" type="button"
                        class="btn btn-success radius" data-lightbox="preview">预览</a>
                </div>
                <div class="col-xs-3 col-sm-3"></div>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>热度：</label>
            <div class="formControls col-xs-6 col-sm-6">
                <input type="text" class="input-text" value="<?php echo isset($vo['focus_sum'])?$vo['focus_sum']: ''; ?>" placeholder="" name="focus_sum"
                    datatype="*" nullmsg="请填写热度">
            </div>
            <div class="col-xs-3 col-sm-3"></div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <button type="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
                <button type="button" class="btn btn-default radius ml-20"
                    onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>

<script type="text/javascript" src="/public/static/admin/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/public/static/admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/public/static/admin/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/public/static/admin/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript" src="/public/static/admin/js/app.js"></script>
<script type="text/javascript" src="/public/static/admin/lib/icheck/jquery.icheck.min.js"></script>

<script type="text/javascript" src="/public/static/admin/lib/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="/public/static/admin/lib/showdown/1.4.2/showdown.min.js"></script>
<script>window.UEDITOR_HOME_URL = '/public/static/admin/lib/ueditor/1.4.3/'</script>
<script type="text/javascript" charset="utf-8" src="/public/static/admin/lib/ueditor/1.4.3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/public/static/admin/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/public/static/admin/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
<script>
    $(function () {
        $("[name='status'][value='<?php echo isset($vo['status'])?$vo['status']: '1'; ?>']").attr("checked", true);

        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });
        var ue = UE.getEditor('editor', {
            serverUrl: '<?php echo \think\Url::build("Ueditor/index"); ?>'
        });
        var converter = new showdown.Converter(),
            text = $("#markdown_tpl").html();
        $("#markdown").html(converter.makeHtml(text));
        $("#form").Validform({
            tiptype: 2,
            ajaxPost: true,
            showAllError: true,
            callback: function (ret) {
                ajax_progress(ret);
            }
        });
    })
    let temp = 0;
    function addUpImg() {
        let imgLen = $('.img-del').length;
        if (imgLen >= 8) return alert("最多能添加9张图片");
        let upload = 'upload' + Math.round(Math.random() * 10000) + (temp++);
        let html = "<div style='margin-top: 5px'><input type=\"text\" readonly class=\"input-text\" name=\"thumb[]\" value=\"<?php echo isset($vo['thumb'])?$vo['thumb']: ''; ?>\" id=\"" + upload + "\" placeholder=\"请点击后面的上传按钮\" datatype=\"*\" nullmsg=\"请填写图片url\" style=\"width: 300px\">\n" +
            "                        <button type=\"button\" class=\"btn btn-primary radius\" onclick=\"layer_open('文件上传','/admin/upload/index/id/" + upload + ".html')\">上传</button>\n" +
            "                        <a onclick=\"$(this).attr('href', 'http://<?php echo \think\Request::instance()->host(); ?>/public'+$('#" + upload + "').val())\" type=\"button\" href=\"\" class=\"btn btn-success radius\" data-lightbox=\"example-1\">预览</a>\n" +
            "                        <span class='img-del' style=\"margin-left: 10px;\" onclick=\"$(this).parent('div').remove()\">删除</span></div>";
        $('#up-box').append(html);
    }
</script>

<script type="text/plain" id="markdown_tpl">
</script>


</body>
</html>